home *** CD-ROM | disk | FTP | other *** search
/ NEC SuperScript 860 Solutions / NEC SuperScript 860 Solutions.iso / internet / scripts.lib / CONNECT.SCR < prev    next >
Text File  |  1994-12-29  |  8KB  |  375 lines

  1. !
  2. !  Copyright (c) 1994
  3. !  by CompuServe Incorporated, Columbus, Ohio
  4. !
  5. !  The information in this software is subject to change without
  6. !  notice and should not be construed as a commitment by CompuServe.
  7. !
  8. !  CONNECT:
  9. !    Handles CompuServe and Direct.
  10. !
  11. !  NOTE:  It is recommended that the numeric codes for networks NOT be
  12. !    modified since other utility programs may assume the relationships
  13. !    of network names and network ids specified below.
  14. !
  15. !+V
  16. ! "3.5.2"
  17. !-V
  18.  
  19. !+N
  20. CompuServe = 1;        ! "CompuServe"
  21. Chilepac= 28;        ! "Chilepac"
  22. CompuPass = 13;        ! "CompuPass"
  23. CSIRnet = 16;        ! "CSIR-Net"
  24. DataPac = 4;        ! "DataPac"
  25. Datex_J = 19;        ! "Datex-J"
  26. Datex_P = 10;        ! "Datex-P"
  27. FALNET = 14;        ! "FALNET"
  28. FENICSII = 24;        ! "FENICS II"
  29. Dialplus = 11;        ! "GNS Dialplus"
  30. InfoNet_Europe = 5;    ! "InfoNet-Euro"
  31. InfoNet_Korea = 29;    ! "InfoNet-Kor"
  32. InfoNet_Mexico = 31;    ! "InfoNet-Mex"
  33. InfoNet_SAfrica = 32;    ! "InfoNet-RSA"
  34. InfoNet_Taiwan = 30;    ! "InfoNet-Taiw"
  35. InfoNet_World = 6;    ! "InfoNet-Wrld"
  36. Internet = 25;        ! "Internet"
  37. ISRAKAV = 17;        ! "ISRAKAV"
  38. LATA = 7;        ! "LATA"
  39. CTLATA = 8;        ! "LATA-Ct"
  40. Mercury = 15;        ! "Mercury"
  41. NIF = 12;        ! "NIFTY LL"
  42. PacNet = 21;        ! "PacNet"
  43. PosServe = 27;        ! "Pos-Serve LL"
  44. Telenet = 2;        ! "SprintNet"
  45. Telepac = 9;        ! "Telepac"
  46. Transpac = 18;        ! "Transpac"
  47. TTNNet = 22;        ! "TTN-Net"
  48. Tymnet = 3;        ! "Tymnet"
  49. VNZNET = 23;        ! "VNZ-Net"
  50. Direct = 40;    ! "Direct"
  51. !-N
  52.  
  53. define %CR = "^M";
  54. define %FALSE = 0;
  55. define %TRUE = 1;
  56. define %ErrorCode = 0;
  57. hangup = 1;
  58. UsingModem = %FALSE;
  59. CISNetwork = %FALSE;
  60.  
  61. !
  62. ! Main Program
  63. !
  64. init %Port, %BaudRate;
  65. if %_init goto Continue_Connect;
  66.  
  67. define %FailureMsg = "Could not initialize port";
  68. define %ErrorCode = 2;
  69. goto Connect_Fatal;
  70.  
  71. Continue_Connect:
  72.     call %Dir & "first.scr" () : Result;
  73.     if Result = %Cancel goto Cancel_Connect;
  74.     if Result = %Failure goto Connect_Failure;
  75.     if Result = %Fatal goto Connect_Fatal;
  76.  
  77.     on cancel goto Cancel_Connect;
  78.     DirectConnect = (%Network = Direct) or (%DialType = 2);
  79.  
  80.     if DirectConnect goto Connect_Network;
  81.  
  82.     call %Dir & "phone.scr" () : Result;
  83.  
  84.     if Result = %Cancel goto Cancel_Connect;
  85.     if Result = %Failure goto Connect_Failure;
  86.     if Result = %Fatal goto Connect_Fatal;
  87.     UsingModem = %TRUE;
  88.  
  89. Connect_Network:
  90.     if %Network = CompuServe goto Connect_CIS;
  91.     if %Network = Direct goto Connect_CIS;
  92.     if %Network = Telenet goto Connect_Telenet;
  93.     if %Network = Tymnet goto Connect_Tymnet;
  94.     if %Network = DataPac goto Connect_DataPac;
  95.     if %Network = InfoNet_Europe goto Connect_InfoNet_Europe;
  96.     if %Network = InfoNet_Korea goto Connect_InfoNet_Korea;
  97.     if %Network = InfoNet_Taiwan goto Connect_InfoNet_Taiwan;
  98.     if %Network = InfoNet_Mexico goto Connect_InfoNet_Mexico;
  99.     if %Network = InfoNet_SAfrica goto Connect_InfoNet_SAfrica;
  100.     if %Network = InfoNet_World goto Connect_InfoNet_World;
  101.     if %Network = Internet goto Connect_Internet;
  102.     if %Network = LATA goto Connect_LATA;
  103.     if %Network = CTLATA goto Connect_CTLATA;
  104.     if %Network = Telepac goto Connect_Telepac;
  105.     if %Network = Datex_P goto Connect_Datex_P;
  106.     if %Network = Datex_J goto Connect_Datex_J;
  107.     if %Network = Dialplus goto Connect_Dialplus;
  108.     if %Network = NIF goto Connect_NIF;
  109.     if %Network = CompuPass goto Connect_CompuPass;
  110.     if %Network = FALNET goto Connect_FALNET;
  111.     if %Network = Mercury goto Connect_Mercury;
  112.     if %Network = CSIRnet goto Connect_CSIRnet;
  113.     if %Network = ISRAKAV goto Connect_ISRAKAV;
  114.     if %Network = Transpac goto Connect_Transpac;
  115.     if %Network = PacNet goto Connect_PacNet;
  116.     if %Network = PosServe goto Connect_PosServe;
  117.     if %Network = TTNNet goto Connect_TTNNet;
  118.     if %Network = FENICSII goto Connect_FENICSII;
  119.     if %Network = VNZNET goto Connect_CIS;
  120.     if %Network = Chilepac goto Connect_Chilepac;
  121.  
  122.     define %FailureMsg = "Network not supported";
  123.     goto Connect_Fatal;
  124.  
  125. !
  126. !  Connect to Telenet
  127. !
  128. Connect_Telenet:
  129.     call %Dir & "telenet.scr" () : Result;
  130.     goto Handle_Network_Return;
  131.  
  132. !
  133. !  Connect to Tymnet
  134. !
  135. Connect_Tymnet:
  136.     call %Dir & "tymnet.scr" (1) : Result;
  137.     goto Handle_Network_Return;
  138.  
  139. !
  140. !  Connect to DataPac
  141. !
  142. Connect_DataPac:
  143.     call %Dir & "datapac.scr" () : Result;
  144.     goto Handle_Network_Return;
  145.  
  146. !
  147. !  Connect to InfoNet World
  148. !
  149. Connect_InfoNet_World:
  150.     call %Dir & "infonet.scr" (0) : Result;
  151.     goto Handle_Network_Return;
  152.  
  153. !
  154. !  Connect to InfoNet Europe
  155. !
  156. Connect_InfoNet_Europe:
  157.     call %Dir & "infonet.scr" (1) : Result;
  158.     goto Handle_Network_Return;
  159.  
  160. !
  161. !  Connect to InfoNet Korea
  162. !
  163. Connect_InfoNet_Korea:
  164.     call %Dir & "infonet.scr" (2) : Result;
  165.     goto Handle_Network_Return;
  166.  
  167. !
  168. !  Connect to InfoNet Taiwan
  169. !
  170. Connect_InfoNet_Taiwan:
  171.     call %Dir & "infonet.scr" (3) : Result;
  172.     goto Handle_Network_Return;
  173.  
  174. !
  175. !  Connect to InfoNet Mexico
  176. !
  177. Connect_InfoNet_Mexico:
  178.     call %Dir & "infonet.scr" (4) : Result;
  179.     goto Handle_Network_Return;
  180.  
  181. !
  182. !  Connect to InfoNet South Africa
  183. !
  184. Connect_InfoNet_SAfrica:
  185.     call %Dir & "infonet.scr" (5) : Result;
  186.     goto Handle_Network_Return;
  187.  
  188. !
  189. !  Connect to LATA
  190. !
  191. Connect_LATA:
  192.     call %Dir & "lata.scr" (%TRUE) : Result;
  193.     goto Handle_Network_Return;
  194.  
  195. !
  196. !  Connect to Connecticut LATA
  197. !
  198. Connect_CTLATA:
  199.     call %Dir & "lata.scr" (%FALSE) : Result;
  200.     goto Handle_Network_Return;
  201.  
  202. !
  203. !  Connect to Connecticut LATA
  204. !
  205. Connect_Internet:
  206.     call %Dir & "internet.scr" (%FALSE) : Result;
  207.     goto Handle_Network_Return;
  208.  
  209. !
  210. !  Connect to Telepac
  211. !
  212. Connect_Telepac:
  213.     call %Dir & "telepac.scr" () : Result;
  214.     goto Handle_Network_Return;
  215.  
  216. !
  217. !  Connect to Datex-P
  218. !
  219. Connect_Datex_P:
  220.     call %Dir & "datexp.scr" () : Result;
  221.     goto Handle_Network_Return;
  222.  
  223. !
  224. !  Connect to Datex-J
  225. !
  226. Connect_Datex_J:
  227.     call %Dir & "datexj.scr" () : Result;
  228.     goto Handle_Network_Return;
  229.  
  230. !
  231. !  Connect to Dialplus
  232. !
  233. Connect_Dialplus:
  234.     call %Dir & "dialplus.scr" () : Result;
  235.     goto Handle_Network_Return;
  236.  
  237. !
  238. !  Connect to NIF
  239. !
  240. Connect_NIF:
  241.     call %Dir & "fenics.scr" (%TRUE) : Result;
  242.     goto Handle_Network_Return;
  243.  
  244. !
  245. !  Connect to CompuPass
  246. !
  247. Connect_CompuPass:
  248.     call %Dir & "fenics.scr" (%FALSE) : Result;
  249.     goto Handle_Network_Return;
  250.  
  251. !
  252. !  Connect to FALNET
  253. !
  254. Connect_FALNET:
  255.     call %Dir & "falnet.scr" (%FALSE) : Result;
  256.     goto Handle_Network_Return;
  257.  
  258. !
  259. !  Connect to Mercury
  260. !
  261. Connect_Mercury:
  262.     call %Dir & "mercury.scr" () : Result;
  263.     goto Handle_Network_Return;
  264.  
  265. !
  266. !  Connect to CSIR-Net
  267. !
  268. Connect_CSIRnet:
  269.     call %Dir & "csirnet.scr" () : Result;
  270.     goto Handle_Network_Return;
  271.  
  272. !
  273. !  Connect to ISRAKAV
  274. !
  275. Connect_ISRAKAV:
  276.     call %Dir & "israkav.scr" () : Result;
  277.     goto Handle_Network_Return;
  278.  
  279. !
  280. !  Connect to Transpac
  281. !
  282. Connect_Transpac:
  283.     call %Dir & "transpac.scr" () : Result;
  284.     goto Handle_Network_Return;
  285.  
  286. !
  287. !  Connect to AlaskaNet
  288. !
  289. Connect_AlaskaNet:
  290.     call %Dir & "tymnet.scr" (2) : Result;
  291.     goto Handle_Network_Return;
  292.  
  293. !
  294. !  Connect to PacNet
  295. !
  296. Connect_PacNet:
  297.     call %Dir & "tymnet.scr" (3) : Result;
  298.     goto Handle_Network_Return;
  299.  
  300.     
  301. !
  302. !  Connect to Pos-Serve
  303. !
  304. Connect_PosServe:
  305.     call %Dir & "posserve.scr" () : Result;
  306.     goto Handle_Network_Return;
  307.  
  308. !
  309. !  Connect to TTN-Net
  310. !
  311. Connect_TTNNet:
  312.     call %Dir & "ttnnet.scr" (3) : Result;
  313.     goto Handle_Network_Return;
  314.  
  315. !
  316. !  Connect to FENICS II
  317. !
  318. Connect_FENICSII:
  319.     call %Dir & "fenics2.scr" (3) : Result;
  320.     goto Handle_Network_Return;
  321.  
  322. !
  323. !  Connect to Chilepac
  324. !
  325. Connect_Chilepac:
  326.     call %Dir & "chilepac.scr" (3) : Result;
  327.     goto Handle_Network_Return;
  328.  
  329. !
  330. !  Handle Network Return
  331. !
  332. Handle_Network_Return:
  333.     if Result = %Success goto Do_CIS_Script;
  334.     if Result = %Cancel goto Cancel_Connect;
  335.     if Result = %Fatal goto Connect_Fatal;
  336.     goto Connect_Failure;
  337.  
  338. !
  339. !  Connect to CIS
  340. !
  341. Connect_CIS:
  342.     CISNetwork = %TRUE;
  343.     send %CR;
  344.  
  345. Do_CIS_Script:
  346.     call %Dir & "cserve.scr" (DirectConnect, CISNetwork) : Result;
  347.     if Result = %Failure goto Connect_Failure;
  348.     if Result = %Cancel goto Cancel_Connect;
  349.     if Result = %Fatal goto Connect_Fatal;
  350.     exit %Success;
  351.  
  352. Connect_Failure:
  353.     gosub Hangup_Connect;
  354.     reset;
  355.     exit %Failure;
  356.  
  357. Connect_Fatal:
  358.     gosub Hangup_Connect;
  359.     reset;
  360.     exit %Fatal;
  361.  
  362. Hangup_Connect:
  363.     if not UsingModem goto Hangup_Done;
  364.     define %LOCAL = 1;
  365.     call %Dir & "disconct.scr" ();
  366. Hangup_Done:
  367.     return;
  368.  
  369. Cancel_Connect:
  370.     show "Connect cancelled";
  371.     gosub Hangup_Connect;
  372.     reset;
  373.     define %ErrorCode = 1;
  374.     exit %Cancel;
  375.